package com.zhangtai.modules.service.security;

import com.zhangtai.modules.dto.SecurityChangeDto;
import com.zhangtai.modules.entity.security.SecurityChangeEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-08-17 20:26:04
 */

public interface SecurityChangeService {

    @GetMapping("/findSecurityChangeList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/infoSecurityChange")
    @ApiOperation(value = "根据id查找")
    SecurityChangeEntity getByIdE(@RequestParam("id") Long id);

    PageResult<SecurityChangeDto> getChangeListAuth(@RequestParam(value = "securityId", required = false) Long securityId,
                                                @RequestParam(value = "operationTime", required = false) String operationTime,
                                                @RequestParam(value = "type", required = false) Integer type,
                                                @RequestParam(value = "name", required = false) String name,
                                                @RequestParam(value = "operateName", required = false) String operateName,
                                                @RequestParam(value = "securityType", required = false) Integer securityType,
                                                @RequestParam(value = "contractIds", required = false) List<Long> contractIds,
                                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult<SecurityChangeDto> getChangeList(@RequestParam(value = "securityId", required = false) Long securityId,
                                                @RequestParam(value = "operationTime", required = false) String operationTime,
                                                @RequestParam(value = "type", required = false) Integer type,
                                                @RequestParam(value = "name", required = false) String name,
                                                @RequestParam(value = "operateName", required = false) String operateName,
                                                @RequestParam(value = "securityType", required = false) Integer securityType,
                                                @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @PostMapping("/saveSecurityChange")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody SecurityChangeEntity entity);

    @PostMapping("/updateSecurityChange")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody SecurityChangeEntity entity);

    @GetMapping("/deleteOneSecurityChange")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteSecurityChanges")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

